/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Donnees;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author mizho
 */
@Entity
@Table(name = "tdue")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TdUe.findAll", query = "SELECT t FROM TdUe t"),
    @NamedQuery(name = "TdUe.findByIdtdue", query = "SELECT t FROM TdUe t WHERE t.idtdue = :idtdue")})
public class TdUe implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2147483647)
    @Column(name = "idtdue")
    private String idtdue;
    @JoinColumn(name = "ue", referencedColumnName = "idue")
    @ManyToOne(optional = false)
    private Ue ue;
    @JoinColumn(name = "td", referencedColumnName = "idtd")
    @ManyToOne(optional = false)
    private Td td;

    public TdUe() {
    }

    public TdUe(String idtdue) {
        this.idtdue = idtdue;
    }

    public String getIdtdue() {
        return idtdue;
    }

    public void setIdtdue(String idtdue) {
        this.idtdue = idtdue;
    }

    public Ue getUe() {
        return ue;
    }

    public void setUe(Ue ue) {
        this.ue = ue;
    }

    public Td getTd() {
        return td;
    }

    public void setTd(Td td) {
        this.td = td;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idtdue != null ? idtdue.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TdUe)) {
            return false;
        }
        TdUe other = (TdUe) object;
        if ((this.idtdue == null && other.idtdue != null) || (this.idtdue != null && !this.idtdue.equals(other.idtdue))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Donnees.TdUe[ idtdue=" + idtdue + " ]";
    }
    
}
